<?php
/**
 * <https://y.st./>
 * Copyright © 2017 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => 'Nearly done for the week',
	'takedown' => '2017-11-01',
	'<{body}>' => <<<END
<img src="/img/CC_BY-SA_4.0/y.st./weblog/2017/10/22.jpg" alt="Trumpet-shaped fungi" class="framed-centred-image" width="800" height="480"/>
<section id="dreams">
	<h2>Dream journal</h2>
	<p>
		I dreamed I was trying to fix a piano, but I couldn&apos;t find the strings.
		Each new panel I found to open on the piano held strange components instead of what I was looking for.
		I woke up before getting anything accomplished.
	</p>
</section>
<section id="university">
	<h2>University life</h2>
	<p>
		It seems Windows doesn&apos;t have a separate administrative command line after all.
		Instead, using the command line in administrative mode confusingly changes the text in the command line window&apos;s title bar, making it look like a separate application.
		Who knew?
		Well, a lot of Windows users probably knew, but I didn&apos;t.
	</p>
	<p>
		I completed as much of my discussion assignments as I was able to, but I still need one more student to post so I can reply:
	</p>
	<blockquote>
		<p>
			$a[PHP] in my native language, but I still think the $a[API] could use some work.
			Built-in functions are inconsistently named, function and class names are case-insensitive, typecasting has some bizarre anomalies ...
			The list goes on.
			Still, $a[PHP] has things to offer that I haven&apos;t seen in other languages.
			For example, $a[PHP] offers a design where object classes are not just objects themselves, but a separate construct.
			That might not seem like a big deal to some people, but it&apos;s the main reason I write my code in $a[PHP] instead of another language.
		</p>
		<p>
			It&apos;s worth noting that Facebook, Google and YouTube aren&apos;t purely server-size when it comes to scripts, as you suggested they were.
			All three are actually pretty packed with JavaScript as well.
			Those websites actually use a combination of server-side and client-side scripting.
		</p>
	</blockquote>
	<blockquote>
		<p>
			The trick of looking for <code>.php</code> at the end of a $a[URI]&apos;s path component won&apos;t always work for identifying $a[PHP] scripts.
			In many cases, directory indexes, which end in a <code>/</code>, will likewise be written in $a[PHP], but no indication is present in the $a[URI].
			Some websites also instead use a <code>.html</code> extension for $a[PHP] files to allow for flexibility in the future.
			If the website changes its scripting language, it won&apos;t have to change all its $a[URI]s, breaking established links.
			This setup is uncommon though, and usually the <code>.html</code> extension is only used for static $a[HTML] pages.
			The file extension is usually used by the Web server daemon to determine the file type (for sending the correct <code>Content-Type</code> header and for processing any files as scripts if need be), but you can configure your Web server so any file extension you want can have any meaning.
			The client doesn&apos;t even need to know what the extension means, as it uses the <code>Content-Type</code> header instead.
		</p>
	</blockquote>
	<blockquote>
		<p>
			Node.js is actually not a language, but the name of a JavaScript interpretor.
			It allows a programmer to use JavaScript to program outside a Web browser.
			In other words, using Node.js on a Web server is a way to use server-side JavaScript.
			Weird, right?
		</p>
	</blockquote>
	<blockquote>
		<p>
			You make a very good point about demand paging.
			I read about it this week, and I understand why it is effective, but I didn&apos;t consider how it relates to this week&apos;s discussion topic.
			Waiting to zero out a page until it&apos;s actually used eliminates the time loss caused by zeroing in cases in which it turns out zeroing won&apos;t be needed after all.
			Waiting to copy pages when forking a process eliminates some needless memory updates as well.
		</p>
	</blockquote>
	<blockquote>
		<p>
			Ouch.
			You  have a point that buying more $a[RAM] will reduce paging, but your idea of disabling the swap partition or swap file seems like a very bad idea.
			If the system needs to page, it needs to page.
			Gimping the system and making it so it can&apos;t use any virtual memory would <strong>*technically*</strong> reduce the costs imposed by paging (by eliminating paging altogether), but it&apos;d also keep your system from allocating memory when it needs to.
			Processes that need more memory will then need to be killed instead of simply causing disk reads/writes.
			Applications really should use less memory than a lot of them do though.
		</p>
	</blockquote>
	<p>
		Perhaps I was a bit hard on myself before.
		Last week, I didn&apos;t attack my coursework at full-force at the beginning of the week, but I still got it done with plenty of time to spare.
		And I&apos;m doing the same thing this week with the same results.
		When life isn&apos;t so hectic, there&apos;s time to relax a bit like this.
		Tomorrow, I should work on research on Linux alternatives to the stupid Windows software we&apos;re required to write about, so I can begin my essay the next day.
	</p>
</section>
END
);
